<!-- 任务查询 -->
<div class="search">
    <nz-select style="width:100px;" [(ngModel)]="status" nzAllowClear nzPlaceHolder="用户状态" (ngModelChange)="searchData()">
      <nz-option *ngFor="let item of statuslist" [nzValue]="item.key" [nzLabel]="item.value"></nz-option>
    </nz-select>
    <nz-cascader nzChangeOnSelect [(ngModel)]="areas" nzPlaceHolder="所在城市" [nzLabelProperty]="'lable'"
      [nzValueProperty]="'value'" [nzOptions]="nzOptions" (ngModelChange)="onChanges($event)"> </nz-cascader>
    <nz-input-group nzSuffixIcon="anticon anticon-search" style="width:50%;margin-left:1rem;">
      <input type="text" nz-input placeholder="输入用户名、登录账号查询" [(ngModel)]="name" (keyup.enter)="searchData()">
    </nz-input-group>
    <a (click)="searchData()">查询</a>
    <!-- <a (click)="add()">新增</a> -->
  </div>
  
  <nz-table #ajaxTable nzShowSizeChanger [nzFrontPagination]="false" [nzData]="dataSet" [nzLoading]="loading" [nzTotal]="total"
    [nzShowTotal]="totalTemplate" [(nzPageIndex)]="pageIndex" [(nzPageSize)]="pageSize" (nzPageIndexChange)="searchData()"
    (nzPageSizeChange)="searchData(true)" [nzScroll]="{ x:'1300px',y: '600px' }">
    <thead>
      <tr>
        <th nzWidth="80px" nzLeft="0px">序号</th>
        <th nzWidth="100px">用户姓名</th>
        <th nzWidth="100px">所在城市</th>
        <th nzWidth="150px">手机号码</th>
        <th nzWidth="150px">代理商户数量</th>
        <th nzWidth="150px">邀请会员数量</th>
        <th nzWidth="150px">账户余额</th>
        <th nzWidth="150px">更新时间</th>
        <th nzWidth="150px" nzRight="0px">操作</th>
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let data of ajaxTable.data;index as i">
        <td nzLeft="0px">{{i+1}}</td>
        <td>{{data.name}}</td>
        <td>{{data.area}}</td>
        <td>{{data.phone}}</td>
        <td>{{data.mernum}}</td>
        <td>{{data.cusnum}}</td>
        <td>{{data.balance}}</td>
        <td>{{data.updateTime | date:"yyyy/MM/dd HH:mm"}}</td>
        <td nzRight="0px">
          <a *ngIf="data.status=='有效'" (click)="lock(data._id)">禁用</a>
          <a *ngIf="data.status!='有效'" (click)="open(data._id)">启用</a>
          <a (click)="edit(data._id)">编辑</a>
          <a (click)="look(data._id)">查看关联餐厅</a>
          <a (click)="inverlist(data._id)">查看招募记录</a>
        </td>
      </tr>
    </tbody>
  </nz-table>
  
  <ng-template #totalTemplate let-total>
    共 {{total}} 条
  </ng-template>
  <nz-modal [(nzVisible)]="isVisible" nzTitle="信息修改" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()" nzWrapClassName="vertical-center-modal"
  [nzMaskClosable]="false" nzWidth="800">
  <div style="margin-bottom: 16px;">
    <nz-input-group nzAddOnBefore="开户行">
      <input type="text" nz-input [(ngModel)]="doc.bank" [disabled]="!isadmin">
    </nz-input-group>
    <nz-input-group nzAddOnBefore="银行卡号">
        <input type="text" nz-input [(ngModel)]="doc.bankno" [disabled]="!isadmin">
      </nz-input-group>
  </div>
  </nz-modal>
  